/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author solriver
 */
@Embeddable
public class ProvincePK implements Serializable {
 
	private static final long serialVersionUID = 1L;
	@Basic(optional = false)
    @Column(name = "CCPP")
    private String ccpp;
    @Basic(optional = false)
    @Column(name = "CCDD")
    private String ccdd;

    public ProvincePK() {
    }

    public ProvincePK(String ccpp, String ccdd) {
        this.ccpp = ccpp;
        this.ccdd = ccdd;
    }

    public String getCcpp() {
        return ccpp;
    }

    public void setCcpp(String ccpp) {
        this.ccpp = ccpp;
    }

    public String getCcdd() {
        return ccdd;
    }

    public void setCcdd(String ccdd) {
        this.ccdd = ccdd;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ccpp != null ? ccpp.hashCode() : 0);
        hash += (ccdd != null ? ccdd.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProvincePK)) {
            return false;
        }
        ProvincePK other = (ProvincePK) object;
        if ((this.ccpp == null && other.ccpp != null) || (this.ccpp != null && !this.ccpp.equals(other.ccpp))) {
            return false;
        }
        if ((this.ccdd == null && other.ccdd != null) || (this.ccdd != null && !this.ccdd.equals(other.ccdd))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.ProvincePK[ ccpp=" + ccpp + ", ccdd=" + ccdd + " ]";
    }
    
}
